package com.campusbook.dao;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.time.LocalDateTime;

@Mapper
public interface BorrowRecordDao {
    
    @Insert("INSERT INTO borrow_records(book_id, borrower_id, owner_id, due_date) " +
            "VALUES(#{bookId}, #{borrowerId}, #{ownerId}, #{dueDate})")
    void save(@Param("bookId") Long bookId, 
              @Param("borrowerId") Long borrowerId, 
              @Param("ownerId") Long ownerId, 
              @Param("dueDate") LocalDateTime dueDate);
}
